#ifndef __SPECIAL_DEVICE_CONTROL_HANDLER_H__
#define __SPECIAL_DEVICE_CONTROL_HANDLER_H__
#include "cocos2d.h"
#include "json/rapidjson.h"
#include "json/document.h"
#include "json/stringbuffer.h"
#include "json/writer.h"
#include "message/ComControlMessage.h"
#include "message/SocketControlMessage.h"
#include "utility/socket/tcp/SocketClient.h"

using namespace cocos2d;
using namespace rapidjson;

class SpecialDeviceControlHandler:public Layer
{
public:
	SpecialDeviceControlHandler();
	~SpecialDeviceControlHandler();

	void handle(Document* doc);
	void handleComMessage(ComControlMessage mess);
	void handleSocketMessage(SocketControlMessage mess);
	
	static void sendComByUsb(const char* data);

private:
	//void handleSocketMessage(SocketControlMessage mess);
	void onSocketRecv(const char* data, int count);
	void onSocketDisconnect();
private:
	SocketClient* m_pSocketClient;
};
#endif